package com.yanghx.order.server.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangHX
 * createTime  2019/9/13 20:45
 */
@RestController
@RequestMapping(value = "/env")
//@RefreshScope 加这个注解。会获取不到配置信息  。 都是null
public class EnvController {

    @Value("${env}")
    private String env;

    @Value("${server.port}")
    private String port;

    @GetMapping("/print")
    private String print() {
        return env;
    }

}
